package com.ebt.m.proposal_v2.ui.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.TextView;

import com.ebt.m.R;
import com.ebt.m.proposal_v2.event.AddMoreInsuredEvent;
import com.ebt.m.proposal_v2.widget.base.CompatLinearLayout;

import org.greenrobot.eventbus.EventBus;

/**
 * 险种信息（包括主险与附加险）
 *
 * @author archer.qi
 *         Created on 2017/5/11.
 */
public class MoreInsuredView extends CompatLinearLayout implements View.OnClickListener{

    private TextView btnAddInsurance;
    public MoreInsuredView(Context context) {
        super(context);
    }

    public MoreInsuredView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    protected int setContentView() {
        return R.layout.proposal_v2_more_insured_view;
    }

    @Override
    protected void onBindView() {
        btnAddInsurance = (TextView) findViewById(R.id.btnAddInsurance);
        btnAddInsurance.setOnClickListener(this);
    }

    @Override
    protected void onDetachedFromWindow() {
        super.onDetachedFromWindow();
    }

    @Override
    protected void onAttachedToWindow() {
        super.onAttachedToWindow();
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()){
            case R.id.btnAddInsurance:
                EventBus.getDefault().post(new AddMoreInsuredEvent());
                break;
        }
    }
}